1

00:00:00,572  -->  00:00:05,224
In the previous video, we already
learn how to looping in the list,

2

00:00:06,000  -->  00:00:14,883
so here we have the list of ip address of all
router, and then we do looping to the list.

3

00:00:15,591  -->  00:00:20,146
But we only configure 1 interface on each router.

4

00:00:21,143  -->  00:00:28,062
Now in this video, we are going to configure
multiple interface in all router at once.

5

00:00:28,850  -->  00:00:35,165
So we will have 2 looping. The first
looping is looping to all router,

6

00:00:35,751  -->  00:00:42,077
and then for each router, we will do
looping again to create multiple interface.

7

00:00:43,100  -->  00:00:51,000
We usually called this method as nested
looping, so we have looping inside looping.

8

00:00:51,900  -->  00:00:57,840
Okay let’s just start, copy
this script, create new file,

9

00:01:00,770  -->  00:01:05,804
let’s say the name is paramiko_looping_nested.py,

10

00:01:11,804  -->  00:01:14,310
And then paste the script here.

11

00:01:15,084  -->  00:01:19,666
So here we already have the
list ip address of all router,

12

00:01:20,000  -->  00:01:23,861
and then here we already looping to the list_ip,

13

00:01:24,568  -->  00:01:32,089
Next here, let’s add script to
configure let’s say loopback 6 until 8.

14

00:01:33,000  -->  00:01:38,746
Here we already have loopback5, so
we will create loopback6 until 8.

15

00:01:39,724  -->  00:01:47,521
Let’s looping here, for x in
range , x is just a variable,

16

00:01:47,697  -->  00:01:51,517
you are free to use anything. And then range

17

00:01:51,612  -->  00:02:01,346
6 until 9. Because we want to create interface
loopback 6 until 8, so we do looping from 6 to 9.

18

00:02:03,149  -->  00:02:06,696
Now let’s put this script inside looping,

19

00:02:07,313  -->  00:02:15,075
we just need to do write one time each router, so
we don’t need to put this script inside looping.

20

00:02:15,863  -->  00:02:24,000
We also just need to configure terminal one time,
so this is also will be outside the looping.

21

00:02:25,021  -->  00:02:27,880
Next, here for the loopback number,

22

00:02:27,943  -->  00:02:37,555
let’s change this to x, so here we need to
use f string, and then change this to x.

23

00:02:39,564  -->  00:02:45,085
For the ip address, this is the
number of loopback increment by 1,

24

00:02:45,680  -->  00:02:54,083
when we create loopback5, the number is 6,
when we create loopback4, the number is 5,

25

00:02:54,903  -->  00:03:05,400
So here we can change this become x + 1. So when
we create loopback 6, the number will be 7.

26

00:03:06,000  -->  00:03:15,048
When we create loopback7, the number will be 8, and
when we create loopback8, the number will be 9.

27

00:03:16,012  -->  00:03:20,192
For the last number will be still the router_id,

28

00:03:20,833  -->  00:03:30,165
Okay done here, save, let’s back to the
terminal, ls, here we can see that we

29

00:03:30,165  -->  00:03:38,578
have paramiko_looping_nested. Let’s
execute this. Just enter enter here.

30

00:03:40,802  -->  00:03:50,346
Okay success login to router 1, and we are
success to create loopback 6 until 8 in router 1,

31

00:03:51,000  -->  00:04:03,789
Router 2 also successs, router 3 success,
router 4 success, and router 5 also success.

32

00:04:04,593  -->  00:04:12,515
Okay so now we are success to do nested
looping, which is looping inside looping.

33

00:04:13,282  -->  00:04:15,684
I think enough for this video

34

00:04:15,853  -->  00:04:19,214
Thank you for watching and see you on the next video.
